#ifndef __BE_OSMESARENDER__
#define __BE_OSMESARENDER__

class OSMesaRender : public Render
{
 private:
  OSMesaContext ctx;
  void *buffer;

 public:
  OSMesaRender();
  ~OSMesaRender();

  void writePPM(const char *_filename);
  bool init( int _width, int _height );
  void setCamera(const Turple3f &_eye, const Turple3f &_center, const Turple3f &_up);
  void clear();
  void draw(Mesh2Ptr _mesh);
  void draw(GLMeshPtr _mesh);
  void begin();
  void end();
  void setMatrix(Turple3f &_loc, Turple2f &_ori);
  void pushMatrix();
  void popMatrix();

};

#endif
